package com.imooc.es.service;

import com.imooc.pojo.PagedGridResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 顾志杰
 * @date 2020/9/7-14:12
 */
@RequestMapping("foodie-es")
public interface ItemSearchService {

    @GetMapping("/search")
    public PagedGridResult seathItems(@RequestParam(value = "keywords",required = false) String keywords,
                                      @RequestParam(value = "sort",required = false) String sort,
                                      @RequestParam(value = "page") Integer page,
                                      @RequestParam(value = "pageSize") Integer pageSize);

    /**
     * 根据分类id搜索商品列表（分页）
     * @param catId
     * @param sort
     * @return
     */
    @GetMapping("/catItems")
    public PagedGridResult seathItems(@RequestParam("keywords") Integer catId,
                                      @RequestParam(value = "sort",required = false) String sort,
                                      @RequestParam(value = "page") Integer page,
                                      @RequestParam(value = "pageSize") Integer pageSize);

}
